package o;

import android.graphics.drawable.Drawable;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.PopupMenu;
import android.widget.TextView;
import o.azf.a;
import o.azf.b;

public class bbe {
    private ImageView ʻ;
    private d ʼ;
    private ImageView ʽ;
    private LinearLayout ˊ;
    private PopupMenu ˊॱ;
    private LinearLayout ˋ;
    private WebView ˋॱ;
    private LinearLayout ˎ;
    private LinearLayout ˏ;
    private String ˏॱ;
    private String ͺ;
    private LinearLayout ॱ;
    private TextView ॱˊ;
    private LinearLayout ॱॱ;
    private ImageView ᐝ;

    public static class d {
        private String ˎ;

        public String ˏ() {
            return this.ˎ;
        }

        public void ˎ(String str) {
            this.ˎ = str;
        }
    }

    public void ˋ(PopupMenu popupMenu) {
        this.ˊॱ = popupMenu;
    }

    public void ॱ(String str) {
        this.ˏॱ = str;
    }

    public boolean ˋ() {
        if (this.ͺ == null || this.ͺ.length() == 0 || !this.ͺ.equals(this.ˏॱ)) {
            return true;
        }
        return false;
    }

    public WebView ˏ() {
        return this.ˋॱ;
    }

    public String ॱ() {
        return this.ͺ;
    }

    public void ˏ(String str) {
        this.ͺ = str;
    }

    public bbe(LinearLayout linearLayout, WebView webView, TextView textView) {
        this.ˏ = linearLayout;
        this.ॱ = (LinearLayout) linearLayout.findViewById(a.ʽ);
        this.ˎ = (LinearLayout) linearLayout.findViewById(a.ʼ);
        this.ˋ = (LinearLayout) linearLayout.findViewById(a.ᐝ);
        this.ʽ = (ImageView) linearLayout.findViewById(a.ʻ);
        this.ˊ = (LinearLayout) linearLayout.findViewById(a.ˋॱ);
        this.ʻ = (ImageView) linearLayout.findViewById(a.ˏॱ);
        this.ॱॱ = (LinearLayout) linearLayout.findViewById(a.ˋ);
        this.ᐝ = (ImageView) linearLayout.findViewById(a.ˎ);
        this.ॱˊ = textView;
        this.ˋॱ = webView;
    }

    public LinearLayout ˎ() {
        return this.ˏ;
    }

    public LinearLayout ˊ() {
        return this.ॱ;
    }

    public d ʻ() {
        return this.ʼ;
    }

    public void ˊ(d dVar) {
        this.ʼ = dVar;
    }

    public void ᐝ() {
        if (this.ॱ.getVisibility() != 8) {
            this.ॱ.setVisibility(8);
        }
    }

    public void ॱॱ() {
        ˏॱ();
        if (this.ॱ.getVisibility() != 0) {
            this.ॱ.setVisibility(0);
        }
    }

    private void ͺ() {
        ˏॱ();
        if (this.ˎ.getVisibility() != 0) {
            this.ˎ.setVisibility(0);
        }
    }

    public LinearLayout ˎ(int i, Drawable drawable, int i2) {
        ͺ();
        if (i == 0) {
            if (this.ˋ.getVisibility() != 0) {
                this.ˋ.setVisibility(0);
            }
            this.ʽ.setImageDrawable(drawable);
            this.ˋ.setContentDescription(ContentManager.getInstant().getContext().getResources().getString(i2));
            return this.ˋ;
        } else if (i != 1) {
            return null;
        } else {
            if (this.ˊ.getVisibility() != 0) {
                this.ˊ.setVisibility(0);
            }
            this.ʻ.setImageDrawable(drawable);
            this.ʻ.setContentDescription(ContentManager.getInstant().getContext().getResources().getString(i2));
            return this.ˊ;
        }
    }

    public void ˏ(Drawable drawable) {
        ͺ();
        if (this.ॱॱ.getVisibility() != 0) {
            this.ॱॱ.setVisibility(0);
        }
        this.ᐝ.setImageDrawable(drawable);
    }

    public LinearLayout ʼ() {
        return this.ॱॱ;
    }

    private void ˏॱ() {
        if (this.ˏ.getVisibility() != 0) {
            this.ˏ.setVisibility(0);
        }
    }

    public void ˏ(boolean z, boolean z2, boolean z3) {
        if (!(z || this.ˋ.getVisibility() == 8)) {
            this.ˋ.setVisibility(8);
        }
        if (!(z2 || this.ˊ.getVisibility() == 8)) {
            this.ˊ.setVisibility(8);
        }
        if (!(z3 || this.ॱॱ.getVisibility() == 8)) {
            this.ॱॱ.setVisibility(8);
        }
        LayoutParams layoutParams = (LinearLayout.LayoutParams) this.ॱˊ.getLayoutParams();
        if (layoutParams == null) {
            layoutParams = new LinearLayout.LayoutParams(-2, -2);
        }
        if ((z || z2 || z3) && this.ॱ.getVisibility() == 8) {
            layoutParams.setMarginEnd(ContentManager.getInstant().getContext().getResources().getDimensionPixelSize(b.ˋ));
        } else {
            layoutParams.setMarginEnd(ContentManager.getInstant().getContext().getResources().getDimensionPixelSize(b.ॱ));
        }
        this.ॱˊ.setLayoutParams(layoutParams);
    }

    public void ʽ() {
        if (this.ˊॱ != null) {
            try {
                this.ˊॱ.dismiss();
            } catch (Exception e) {
                if (Logger.ˎ()) {
                    azh.ˏ.ˏ("WebViewMenu", "popupMenu.dismiss error ");
                }
            }
        }
    }
}
